package priv.blackbibo.application.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Handler;
import android.transition.Explode;
import android.view.Window;
import android.widget.ImageView;

import java.util.logging.Level;

import priv.blackbibo.application.R;

public class FuallScreenPhotoActivity extends AppCompatActivity {

    private Handler handler = new Handler();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fuall_screen_photo);
        Thread thread = new Thread(){
            @Override
            public void run() {
                handler.post(()->{
                    show();
                });
            }
        };
        thread.start();

//        // inside your activity (if you did not enable transitions in your theme)
//        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
//        // set an exit transition
//        getWindow().setExitTransition(new Explode());
    }

    private void show() {
        Intent intent = this.getIntent();
        String path = intent.getStringExtra("path");
        BitmapFactory.Options options =new BitmapFactory.Options();
        options.inJustDecodeBounds = false;
        options.inSampleSize = 2;
        Bitmap raw = BitmapFactory.decodeFile(path, options);
        ImageView imageView = findViewById(R.id.images);
        imageView.setImageBitmap(raw);
    }
}
